#include "udp_echo_server.hpp"
#include <memory>

void Usage(const std::string& proc)
{
    std::cout << "Usage error! \n\t" << proc << "local_port" << std::endl;
}

int main(int argc, const char* argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(USAGE_ERROR);
    }

    // 将日志打印到显示器上
    EnableScreen();
    uint16_t port = std::stoi(argv[1]);

    std::unique_ptr<UdpServer> udp_server = std::make_unique<UdpServer>(port); // C++14
    udp_server->InitServer();
    udp_server->Start();

    return 0;
}
 